" Configuration file for vim
"set modelines=0		" CVE-2007-2438

" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
"set nocompatible	" Use Vim defaults instead of 100% vi compatibility
"set backspace=2		" more powerful backspacing

" Don't write backup file if vim is being called by "crontab -e"
"au BufWrite /private/tmp/crontab.* set nowritebackup nobackup
" Don't write backup file if vim is being called by "chpass"
"au BufWrite /private/etc/pw.* set nowritebackup nobackup

call pathogen#infect()
syntax enable "语法高亮
filetype plugin on "文件类型插件开启

filetype plugin indent on "文件插件
set nu "显示行号
set ruler "在右下角显示光标的坐标
set hlsearch "高亮显示搜索结果
set incsearch "边输边搜，即时更新搜索结果
set showcmd "在ruler左边显示当前正在输入的命令

set expandtab "将tab键改为空格，默认是8个
set tabstop=4 "将tab键改为4个空格
set cindent "使用C语言的规则自动缩进
set shiftwidth=4 "自动缩进时，使用4个空格，默认是8个
"set modeline "自动识别文件格式
set fdm=indent "代码折叠
set nofoldenable
"上一个/下一个标签页切换的快捷键
nmap <F11> <ESC>:tabprevious<RETURN>
nmap <F12> <ESC>:tabnext<RETURN>

"NERDTREE插件配置 
au VimEnter * NERDTree " 启动vim开启目录树 
let NERDTreeWinSize=24 
let NERDTreeShowBookmarks=1 
let NERDTreeChDirMode=2 
map <F7> :NERDTreeToggle<CR> 

autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,makrdown setlocal omnifunc=htmlcomplete#CompletTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompletTags
autocmd FileType php setlocal omnifunc=xmlcomplete#CompletPHP

colorscheme jellybeans "vim 主题高级美化

let mapleader = "," "注释工具设置为

"vim-airline 美化状态栏
let g:airline_theme="luna" 
"设置字体
"let g:airline_powerline_fonts=1
"语法开启
let g:airline#extensions#syntastic#enabled = 1

if !exists('g:airline_symbols')
    let g:airline_symbols = {}
endif
"old vim-powerline symbols
let g:airline_left_sep = '▶'
let g:airline_right_sep = '◀'
let g:airline_symbols.crypt = '🔒'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.notexists = '∄'
let g:airline_symbols.whitespace = 'Ξ'

"vital 极其重要的设置powerline 单页面无状态
set nocompatible 
set laststatus=2
set t_Co=256 
let g:Powerline_symbols = 'unicode'
